package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.EcologyHatchRecordsRewards;
import com.sc.nft.mapper.EcologyHatchRecordsRewardsMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户熔炼奖励快照dao层
 *
 * @Author：LiGen
 * @Package：com.sc.nft.dao
 * @Project：sc_metago
 * @name：EcologyHatchRecordsRewardsDao
 * @Date：2024/7/20 18:01
 * @Filename：EcologyHatchRecordsRewardsDao
 */
@Slf4j
@Repository
public class EcologyHatchRecordsRewardsDao extends ServiceImpl<EcologyHatchRecordsRewardsMapper, EcologyHatchRecordsRewards> {

    /**
     * 获取熔炼记录快照奖励列表
     *
     * @param userEcologyHatchRecordsId
     * @return
     */
    public List<EcologyHatchRecordsRewards> getListByEcologyHatchRecordsId(Long userEcologyHatchRecordsId) {
        LambdaQueryWrapper<EcologyHatchRecordsRewards> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(EcologyHatchRecordsRewards::getUserEcologyHatchRecordsId, userEcologyHatchRecordsId);
        return list(wrapper);
    }

    public void saveList(List<EcologyHatchRecordsRewards> list) {
        baseMapper.saveList(list);
    }
}
